package edu.ucsc.gameAI.conditions;

import edu.ucsc.gameAI.ICondition;
import pacman.game.Game;

public class PowerPillInRegion implements ICondition{

	int x1;
	int y1;
	int x2;
	int y2;

	public PowerPillInRegion(int i, int j, int k, int l) {
		x1 = i;
		y1 = j;
		x2 = k;
		y2 = l;
	}

	public boolean test(Game game) {
		for(int pill : game.getActivePowerPillsIndices())
		{
			int x = game.getNodeXCood(pill);
			int y = game.getNodeYCood(pill);

			if ( (x1 < x) && (y1 < y) && (x2 > x) && (y2 > y) )
				return true;
		}
		return false;
	}

}
